package com.lst.api.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.lst.api.vo.AssetsHouseInfoVo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;

import com.lst.tools.mybatis.entity.DeleteBaseModel;

/**
 * 资产信息中的房产信息
 *
 * @author Frank
 * @date 2019-12-30 10:31:37
 * @version: V1.0
 */
@Data
@NoArgsConstructor
@TableName(value = "lst_assets_house_info")
@ApiModel(value = "资产信息中的房产信息")
public class AssetsHouseInfo extends DeleteBaseModel {

    public static final String APPLY_NO = "apply_no";
    public static final String PROMO_USER_ID = "promo_user_id";
    public static final String ADDRESS_PROVINCE_CODE = "address_province_code";
    public static final String ADDRESS_CITY_CODE = "address_city_code";
    public static final String ADDRESS_AREA_CODE = "address_area_code";
    public static final String ADDRESS_DETAILS = "address_details";
    public static final String OWNER = "owner";
    public static final String BUY_TYPE = "buy_type";
    public static final String TOTAL_LOAN_AMOUNT = "total_loan_amount";
    public static final String MONTHLY_SUPPLY = "monthly_supply";
    public static final String LOAN_BANK_ID = "loan_bank_id";
    public static final String LOAN_YEARS = "loan_years";
    public static final String BUY_TOTAL_AMOUNT = "buy_total_amount";
    public static final String BUILD_AREA = "build_area";
    public static final String TOTAL_HOUSE = "total_house";

    @ApiModelProperty(name = "applyNo", value = "申请编号", dataType = "String")
    @TableField(value = APPLY_NO)
    private String applyNo;

    @ApiModelProperty(name = "promoUserId", value = "推销员用户id", dataType = "Long")
    @TableField(value = PROMO_USER_ID)
    private Long promoUserId;

    @ApiModelProperty(name = "addressProvinceCode", value = "房产地址，省编号", dataType = "String")
    @TableField(value = ADDRESS_PROVINCE_CODE)
    private String addressProvinceCode;

    @ApiModelProperty(name = "addressCityCode", value = "房产地址，市编号", dataType = "String")
    @TableField(value = ADDRESS_CITY_CODE)
    private String addressCityCode;

    @ApiModelProperty(name = "addressAreaCode", value = "房产地址，区编号", dataType = "String")
    @TableField(value = ADDRESS_AREA_CODE)
    private String addressAreaCode;

    @ApiModelProperty(name = "addressDetails", value = "房产地址，详细地址", dataType = "String")
    @TableField(value = ADDRESS_DETAILS)
    private String addressDetails;

    @ApiModelProperty(name = "owner", value = "共有人", dataType = "String")
    @TableField(value = OWNER)
    private String owner;

    @ApiModelProperty(name = "buyType", value = "购房方式    0:一次性    1:按揭", dataType = "String")
    @TableField(value = BUY_TYPE)
    private String buyType;

    @ApiModelProperty(name = "totalLoanAmount", value = "贷款总额,单位元", dataType = "Double")
    @TableField(value = TOTAL_LOAN_AMOUNT)
    private Double totalLoanAmount;

    @ApiModelProperty(name = "monthlySupply", value = "月供，单位元", dataType = "Double")
    @TableField(value = MONTHLY_SUPPLY)
    private Double monthlySupply;

    @ApiModelProperty(name = "loanBankId", value = "贷款银行id", dataType = "Long")
    @TableField(value = LOAN_BANK_ID)
    private Long loanBankId;

    @ApiModelProperty(name = "loanYears", value = "贷款年限，单位年", dataType = "Integer")
    @TableField(value = LOAN_YEARS)
    private Integer loanYears;

    @ApiModelProperty(name = "buyTotalAmount", value = "购买总金额", dataType = "Double")
    @TableField(value = BUY_TOTAL_AMOUNT)
    private Double buyTotalAmount;

    @ApiModelProperty(name = "buildArea", value = "建筑面积，单位平方米", dataType = "Double")
    @TableField(value = BUILD_AREA)
    private Double buildArea;

    @ApiModelProperty(name = "totalHouse", value = "房产总数", dataType = "Integer")
    @TableField(value = TOTAL_HOUSE)
    private Integer totalHouse;

    public AssetsHouseInfo(long userId, String applyNo, AssetsHouseInfoVo assetsHouseInfoVo) {
        this.applyNo = applyNo;
        this.promoUserId = userId;
        this.addressProvinceCode = assetsHouseInfoVo.getAddressProvinceCode();
        this.addressCityCode = assetsHouseInfoVo.getAddressCityCode();
        this.addressAreaCode = assetsHouseInfoVo.getAddressAreaCode();
        this.addressDetails = assetsHouseInfoVo.getAddressDetails();
        this.owner = assetsHouseInfoVo.getOwner();
        this.buyType = assetsHouseInfoVo.getBuyType();
        this.totalLoanAmount = assetsHouseInfoVo.getTotalLoanAmount();
        this.monthlySupply = assetsHouseInfoVo.getMonthlySupply();
        this.loanBankId = assetsHouseInfoVo.getLoanBankId();
        this.loanYears = assetsHouseInfoVo.getLoanYears();
        this.buyTotalAmount = assetsHouseInfoVo.getBuyTotalAmount();
        this.buildArea = assetsHouseInfoVo.getBuildArea();
        this.totalHouse = assetsHouseInfoVo.getTotalHouse();
    }
}